changed image size lookup to use JS