Added error handling in animated pictures