Bug 1037097: restrict image decode size in MediaFrame based on device memory size

@davidflanagan -- wouldn't it be better to load these constants from a configuration file rather than adding all the logic in this file? It will help customize these values easier if loaded from a configuration.