Added image size validation