got rid of nasty white flash when img resize was too big