adding flip error handling on last image