scale correctly with image size