code: private byte[] readImage(String uriWithParams) {
  
          try {
              String pathAndQuery = OpenCms.getLinkManager().getRootPath(m_cms, uriWithParams);
              URI uri = new URI(pathAndQuery);
              String path = uri.getPath();
              String query = uri.getQuery();
              String scaleParams = null;
              if (query != null) {
                  Matcher matcher = SCALE_PARAMS_PATTERN.matcher(query);
                  if (matcher.find()) {
                      scaleParams = matcher.group(1);
                  }
              }
              CmsFile imageFile = m_rootCms.readFile(path);
              byte[] result = imageFile.getContents();
              if (scaleParams != null) {
                  CmsImageScaler scaler = new CmsImageScaler(scaleParams);
                  result = scaler.scaleImage(imageFile);
              }
              return result;
          } catch (Exception e) {
              LOG.error("Problem with reading image " + uriWithParams + ": " + e.getLocalizedMessage(), e);
              return null;
          }
      }
docs: Reads an image from the VFS, scaling it if necessary.<p>
  
  @param uriWithParams the image uri, possible with scaling parameter
  
  @return the image data