Fixed animated gif save and resize/crop using imagick

php5-imagick has a bug and animated gifs aren't stored as animated.

Replaced writeImage function with fopen and writeImagesFile.

Now animated gif are resized/croped with animation :)