Add check to GetFrame function to handle a frame number greater than total number of frames

This will allow handling a case where a GetFrame request may be for a frame number greater than the total number of frames. It will simply set n to the last frame and return that. This came up out of the issue discussed starting here: http://forum.doom9.org/showthread.php?p=1653750#post1653750