Valid image function was incorrected merged, fixed now