Update image size logic