Fix image size before loading it