fix exception handling for all security
fix gif resource calling