cache image and render it with correct dimensions