Fixed bug where invalid images would still publish