Fixed overflow for incorrectly sized images