prevent error on last image