try
{
final ResourceData data = resourceManager.load(url);
final byte[] imageData = data.getResource(resourceManager);
final String mimeType = queryMimeType(imageData);
final URL maybeRealURL = resourceManager.toURL(url);
if (maybeRealURL != null)
{
final String originalFileName = IOUtils.getInstance().getFileName(maybeRealURL);
return new ImageData(imageData, mimeType, originalFileName);
}