Gallery2: Fix force close issue when trim video

- Only mp4 and 3gp file support trim function
CRs-Fixed: 652838

Change-Id: Ib265b96925b84fab458800fea9901ea928c411bb
Gallery2: Fix Gallery crash when exit playing gif pic.

When we press back key to exit playing gif pic,the decoder is
free and set to null,which casuse this bug happened.

Add a condition to avoid the NullPointerException.

CRs-fixed: 653709

Change-Id: Iab299554c252c3a1c9352b498cd946cb53e47cc7