Detect invalid images and only send images once