scaling adjusted to float input, and images other than square ones now work