#1125 Fix upload image tests and logic