With OQL you can retrieve the Mendix object that is a specialization of the System.Image entity, like you can fetch any other object. Once you have this object the file should be accesible from the standard Mx functionality. The file content is not available as this is stored on disk and not in the db.