fixing photos error by adding min